# Maintainer:
pkgname=py3-xxhash
pkgver=3.4.1
pkgrel=1
pkgdesc="Python Binding for xxHash"
url="https://github.com/ifduyue/python-xxhash"
arch="all"
license="BSD-2-Clause"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	xxhash-dev
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ifduyue/python-xxhash/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/python-xxhash-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	export XXHASH_LINK_SO=1
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	cd .testenv
	bin/python3 -m unittest discover ../tests/
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}
sha512sums="
23b3950e289306363558e525563b520a69a44f509324d372e1f6b00e19d461b0a3e67c1cea3c75aae14ef68130d46d6d477db2638eae0ad25c161457237cb1ab  py3-xxhash-3.4.1.tar.gz
"
